<!--  -->
<template>
  <div class="school">
    <h1>学校名字： {{ name }}</h1>
    <h1>地址： {{ address }}</h1>
  </div>
</template>

<script>
export default {
  name: "School",
  props: ["getSchoolName"],
  data() {
    return {
      name: "xgg",
      address: "北京",
    };
  },
  mounted() {
    this.$bus.$on("hello", (data) =>{
      console.log("我是School 组件， 收到了数据", data)
    })
  },
  beforeDestroy() {
    this.$bus.$off("hello")
  }

};
</script>

<style  scoped>
.school {
  background-color: orange;
  padding: 5px;
  margin-top: 10px;
}
</style>
